<template>
  <div class="selectName">
    <a-form-model layout="inline" :model="form" :rules="rules" ref="selectForm">
      <a-form-model-item prop="likeName">
        <a-input v-model="form.likeName" placeholder="名称搜索" />
      </a-form-model-item>

      <a-form-model-item>
        <a-button type="primary" @click="onSubmit">查询</a-button>
        <a-button style="margin-left: 10px;" @click="resetForm">重置</a-button>
      </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
export default {
  name: 'selectName',
  data() {
    return {
      form: {
        likeName: ''
      },
      rules: {
        name: [{ required: true, message: '请输入名称搜索', trigger: 'blur' }]
      }
    }
  },
  methods: {
    onSubmit() {
      this.$emit('selectSearch',this.form)
      // this.$refs.ruleForm.validate((valid) => {
      //   if (valid) {
       
      //   } else {
        
      //     return false
      //   }
      // })
    },
    resetForm() {
      this.$refs.selectForm.resetFields()
    }
  }
}
</script>

<style lang="less" scoped>
</style>
